<template>
  <div class="home">
    <div class="header">
      <img src="../assets/images/1.jpg" alt="" />
    </div>
    <!-- 病毒信息 -->
    <covid-info :covidInfo="covidInfo" :news="news"></covid-info>
    <!-- 疫情导航条 -->
    <covid-nav></covid-nav>
    <!-- 病毒数据统计 -->
    <covid-num :covidNumber="covidNumber"></covid-num>
    <!-- 疫情地图 -->
    <covid-map></covid-map>
    <!-- 疫情轮播图 -->
    <covid-swiper></covid-swiper>
    <!-- 疫情期间出行政策 -->
    <!-- <covid-vant></covid-vant> -->
  </div>
</template>

<script>
// @ is an alias to /src
import CovidInfo from "./Covid/CovidInfo.vue";
import CovidNum from "./Covid/CovidNum.vue";
import CovidMap from "./Covid/CovidMap.vue";
import CovidSwiper from "./Covid/CovidSwiper.vue";
// import CovidVant from "./Covid/CovidVant.vue";
import CovidNav from "./Covid/Covidnav/CovidNav.vue";

export default {
  name: "Home",
  components: {
    CovidInfo,
    CovidNum,
    CovidMap,
    CovidSwiper,
    // CovidVant,
    CovidNav,
  },
  data() {
    return {
      //病毒信息
      covidInfo: {
        note1: "",
        note2: "",
        note3: "",
        remark1: "",
        remark2: "",
        remark3: "",
      },
      //疫情数量
      covidNumber: {
        currentConfirmedCount: "", //现存确诊人数
        confirmedCount: "", //累计确诊人数
        suspectedCount: "", //累计境外输入人数
        curedCount: "", //累计治愈人数
        deadCount: "", //累计死亡人数
        seriousCount: "", //现存无症状人数
        suspectedIncr: "", //新增境外输入人数
        currentConfirmedIncr: "", //相比昨天现存确诊人数
        confirmedIncr: "", //相比昨天累计确诊人数
        curedIncr: "", //相比昨天新增治愈人数
        deadIncr: "", //相比昨天新增死亡人数
        seriousIncr: "", //相比昨天现存无症状人数
        modifyTime: "", //更新时间
      },
      //疫情热门新闻
      news: [],
    };
  },
  created() {
    console.log(this.$api);
    this.$api.getCovidInfo().then((res) => {
      if (res.data.code == 200) {
        console.log(res.data.newslist[0]);
        let desc = res.data.newslist[0].desc;
        // 病毒描述
        this.covidInfo = desc;
        // 疫情数量
        this.covidNumber = desc;
        //疫情热点
        this.news = res.data.newslist[0].news;
        console.log("news", this.news);
      }
    });
  },
};
</script>

<style lang="less" scoped>
.header {
  img {
    width: 100%;
  }
}
</style>
